package com.zjut.zs.userschool.manager;

import java.util.List;

import javax.annotation.Resource;

import com.zjut.an.util.module.PageModule;
import com.zjut.zs.userschool.dao.ZsUserSchool;
import com.zjut.zs.userschool.dao.ZsUserSchoolDAO;


public class ZsUserSchoolManager {

	@Resource(name = "ZsUserSchoolDAO")
	private ZsUserSchoolDAO dao;
	
	public void addData(ZsUserSchool obj) {	
		dao.save(obj);
	}
	
	public void updateData(ZsUserSchool obj) {
		dao.update(obj);
	}
	
	public void deleteData(ZsUserSchool obj) {
		dao.delete(obj);
	}

	public void deleteDatas(List<ZsUserSchool> objlist) {
		for (ZsUserSchool ZsUserSchool : objlist) {
			dao.delete(ZsUserSchool);
		}
	}
	
	public PageModule getDataByInstance (int pageNumber,int pageSize, String sort, String order, ZsUserSchool obj) {
		return dao.findByInstance(pageNumber, pageSize, sort, order, obj);
	}
	
	public List getDatas() {
		return dao.findAll();
	}

	public ZsUserSchool getData(int objId) {
		return dao.findById(objId);
	}
}
